{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\n\n/* eslint-disable react/default-props-match-prop-types, react/no-multi-comp, react/prop-types */\nimport * as React from 'react';\nimport { useRef } from 'react';\nimport findDOMNode from \"rc-util/es/Dom/findDOMNode\";\nimport { fillRef, supportRef } from \"rc-util/es/ref\";\nimport classNames from 'classnames';\nimport { getTransitionName, supportTransition } from './util/motion';\nimport { STATUS_NONE, STEP_PREPARE, STEP_START } from './interface';\nimport useStatus from './hooks/useStatus';\nimport DomWrapper from './DomWrapper';\nimport { isActive } from './hooks/useStepQueue';\n/**\n * `transitionSupport` is used for none transition test case.\n * Default we use browser transition event support check.\n */\n\nexport function genCSSMotion(config) {\n  var transitionSupport = config;\n  if (_typeof(config) === 'object') {\n    transitionSupport = config.transitionSupport;\n  }\n  function isSupportTransition(props) {\n    return !!(props.motionName && transitionSupport);\n  }\n  var CSSMotion = /*#__PURE__*/React.forwardRef(function (props, ref) {\n    var _props$visible = props.visible,\n      visible = _props$visible === void 0 ? true : _props$visible,\n      _props$removeOnLeave = props.removeOnLeave,\n      removeOnLeave = _props$removeOnLeave === void 0 ? true : _props$removeOnLeave,\n      forceRender = props.forceRender,\n      children = props.children,\n      motionName = props.motionName,\n      leavedClassName = props.leavedClassName,\n      eventProps = props.eventProps;\n    var supportMotion = isSupportTransition(props); // Ref to the react node, it may be a HTMLElement\n\n    var nodeRef = useRef(); // Ref to the dom wrapper in case ref can not pass to HTMLElement\n\n    var wrapperNodeRef = useRef();\n    function getDomElement() {\n      try {\n        // Here we're avoiding call for findDOMNode since it's deprecated\n        // in strict mode. We're calling it only when node ref is not\n        // an instance of DOM HTMLElement. Otherwise use\n        // findDOMNode as a final resort\n        return nodeRef.current instanceof HTMLElement ? nodeRef.current : findDOMNode(wrapperNodeRef.current);\n      } catch (e) {\n        // Only happen when `motionDeadline` trigger but element removed.\n        return null;\n      }\n    }\n    var _useStatus = useStatus(supportMotion, visible, getDomElement, props),\n      _useStatus2 = _slicedToArray(_useStatus, 4),\n      status = _useStatus2[0],\n      statusStep = _useStatus2[1],\n      statusStyle = _useStatus2[2],\n      mergedVisible = _useStatus2[3]; // Record whether content has rendered\n    // Will return null for un-rendered even when `removeOnLeave={false}`\n\n    var renderedRef = React.useRef(mergedVisible);\n    if (mergedVisible) {\n      renderedRef.current = true;\n    } // ====================== Refs ======================\n\n    var setNodeRef = React.useCallback(function (node) {\n      nodeRef.current = node;\n      fillRef(ref, node);\n    }, [ref]); // ===================== Render =====================\n\n    var motionChildren;\n    var mergedProps = _objectSpread(_objectSpread({}, eventProps), {}, {\n      visible: visible\n    });\n    if (!children) {\n      // No children\n      motionChildren = null;\n    } else if (status === STATUS_NONE || !isSupportTransition(props)) {\n      // Stable children\n      if (mergedVisible) {\n        motionChildren = children(_objectSpread({}, mergedProps), setNodeRef);\n      } else if (!removeOnLeave && renderedRef.current) {\n        motionChildren = children(_objectSpread(_objectSpread({}, mergedProps), {}, {\n          className: leavedClassName\n        }), setNodeRef);\n      } else if (forceRender) {\n        motionChildren = children(_objectSpread(_objectSpread({}, mergedProps), {}, {\n          style: {\n            display: 'none'\n          }\n        }), setNodeRef);\n      } else {\n        motionChildren = null;\n      }\n    } else {\n      var _classNames;\n\n      // In motion\n      var statusSuffix;\n      if (statusStep === STEP_PREPARE) {\n        statusSuffix = 'prepare';\n      } else if (isActive(statusStep)) {\n        statusSuffix = 'active';\n      } else if (statusStep === STEP_START) {\n        statusSuffix = 'start';\n      }\n      motionChildren = children(_objectSpread(_objectSpread({}, mergedProps), {}, {\n        className: classNames(getTransitionName(motionName, status), (_classNames = {}, _defineProperty(_classNames, getTransitionName(motionName, \"\".concat(status, \"-\").concat(statusSuffix)), statusSuffix), _defineProperty(_classNames, motionName, typeof motionName === 'string'), _classNames)),\n        style: statusStyle\n      }), setNodeRef);\n    } // Auto inject ref if child node not have `ref` props\n\n    if ( /*#__PURE__*/React.isValidElement(motionChildren) && supportRef(motionChildren)) {\n      var _motionChildren = motionChildren,\n        originNodeRef = _motionChildren.ref;\n      if (!originNodeRef) {\n        motionChildren = /*#__PURE__*/React.cloneElement(motionChildren, {\n          ref: setNodeRef\n        });\n      }\n    }\n    return /*#__PURE__*/React.createElement(DomWrapper, {\n      ref: wrapperNodeRef\n    }, motionChildren);\n  });\n  CSSMotion.displayName = 'CSSMotion';\n  return CSSMotion;\n}\nexport default genCSSMotion(supportTransition);","map":{"version":3,"names":["_defineProperty","_objectSpread","_slicedToArray","_typeof","React","useRef","findDOMNode","fillRef","supportRef","classNames","getTransitionName","supportTransition","STATUS_NONE","STEP_PREPARE","STEP_START","useStatus","DomWrapper","isActive","genCSSMotion","config","transitionSupport","isSupportTransition","props","motionName","CSSMotion","forwardRef","ref","_props$visible","visible","_props$removeOnLeave","removeOnLeave","forceRender","children","leavedClassName","eventProps","supportMotion","nodeRef","wrapperNodeRef","getDomElement","current","HTMLElement","e","_useStatus","_useStatus2","status","statusStep","statusStyle","mergedVisible","renderedRef","setNodeRef","useCallback","node","motionChildren","mergedProps","className","style","display","_classNames","statusSuffix","concat","isValidElement","_motionChildren","originNodeRef","cloneElement","createElement","displayName"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/rc-motion/es/CSSMotion.js"],"sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\n\n/* eslint-disable react/default-props-match-prop-types, react/no-multi-comp, react/prop-types */\nimport * as React from 'react';\nimport { useRef } from 'react';\nimport findDOMNode from \"rc-util/es/Dom/findDOMNode\";\nimport { fillRef, supportRef } from \"rc-util/es/ref\";\nimport classNames from 'classnames';\nimport { getTransitionName, supportTransition } from './util/motion';\nimport { STATUS_NONE, STEP_PREPARE, STEP_START } from './interface';\nimport useStatus from './hooks/useStatus';\nimport DomWrapper from './DomWrapper';\nimport { isActive } from './hooks/useStepQueue';\n/**\n * `transitionSupport` is used for none transition test case.\n * Default we use browser transition event support check.\n */\n\nexport function genCSSMotion(config) {\n  var transitionSupport = config;\n\n  if (_typeof(config) === 'object') {\n    transitionSupport = config.transitionSupport;\n  }\n\n  function isSupportTransition(props) {\n    return !!(props.motionName && transitionSupport);\n  }\n\n  var CSSMotion = /*#__PURE__*/React.forwardRef(function (props, ref) {\n    var _props$visible = props.visible,\n        visible = _props$visible === void 0 ? true : _props$visible,\n        _props$removeOnLeave = props.removeOnLeave,\n        removeOnLeave = _props$removeOnLeave === void 0 ? true : _props$removeOnLeave,\n        forceRender = props.forceRender,\n        children = props.children,\n        motionName = props.motionName,\n        leavedClassName = props.leavedClassName,\n        eventProps = props.eventProps;\n    var supportMotion = isSupportTransition(props); // Ref to the react node, it may be a HTMLElement\n\n    var nodeRef = useRef(); // Ref to the dom wrapper in case ref can not pass to HTMLElement\n\n    var wrapperNodeRef = useRef();\n\n    function getDomElement() {\n      try {\n        // Here we're avoiding call for findDOMNode since it's deprecated\n        // in strict mode. We're calling it only when node ref is not\n        // an instance of DOM HTMLElement. Otherwise use\n        // findDOMNode as a final resort\n        return nodeRef.current instanceof HTMLElement ? nodeRef.current : findDOMNode(wrapperNodeRef.current);\n      } catch (e) {\n        // Only happen when `motionDeadline` trigger but element removed.\n        return null;\n      }\n    }\n\n    var _useStatus = useStatus(supportMotion, visible, getDomElement, props),\n        _useStatus2 = _slicedToArray(_useStatus, 4),\n        status = _useStatus2[0],\n        statusStep = _useStatus2[1],\n        statusStyle = _useStatus2[2],\n        mergedVisible = _useStatus2[3]; // Record whether content has rendered\n    // Will return null for un-rendered even when `removeOnLeave={false}`\n\n\n    var renderedRef = React.useRef(mergedVisible);\n\n    if (mergedVisible) {\n      renderedRef.current = true;\n    } // ====================== Refs ======================\n\n\n    var setNodeRef = React.useCallback(function (node) {\n      nodeRef.current = node;\n      fillRef(ref, node);\n    }, [ref]); // ===================== Render =====================\n\n    var motionChildren;\n\n    var mergedProps = _objectSpread(_objectSpread({}, eventProps), {}, {\n      visible: visible\n    });\n\n    if (!children) {\n      // No children\n      motionChildren = null;\n    } else if (status === STATUS_NONE || !isSupportTransition(props)) {\n      // Stable children\n      if (mergedVisible) {\n        motionChildren = children(_objectSpread({}, mergedProps), setNodeRef);\n      } else if (!removeOnLeave && renderedRef.current) {\n        motionChildren = children(_objectSpread(_objectSpread({}, mergedProps), {}, {\n          className: leavedClassName\n        }), setNodeRef);\n      } else if (forceRender) {\n        motionChildren = children(_objectSpread(_objectSpread({}, mergedProps), {}, {\n          style: {\n            display: 'none'\n          }\n        }), setNodeRef);\n      } else {\n        motionChildren = null;\n      }\n    } else {\n      var _classNames;\n\n      // In motion\n      var statusSuffix;\n\n      if (statusStep === STEP_PREPARE) {\n        statusSuffix = 'prepare';\n      } else if (isActive(statusStep)) {\n        statusSuffix = 'active';\n      } else if (statusStep === STEP_START) {\n        statusSuffix = 'start';\n      }\n\n      motionChildren = children(_objectSpread(_objectSpread({}, mergedProps), {}, {\n        className: classNames(getTransitionName(motionName, status), (_classNames = {}, _defineProperty(_classNames, getTransitionName(motionName, \"\".concat(status, \"-\").concat(statusSuffix)), statusSuffix), _defineProperty(_classNames, motionName, typeof motionName === 'string'), _classNames)),\n        style: statusStyle\n      }), setNodeRef);\n    } // Auto inject ref if child node not have `ref` props\n\n\n    if ( /*#__PURE__*/React.isValidElement(motionChildren) && supportRef(motionChildren)) {\n      var _motionChildren = motionChildren,\n          originNodeRef = _motionChildren.ref;\n\n      if (!originNodeRef) {\n        motionChildren = /*#__PURE__*/React.cloneElement(motionChildren, {\n          ref: setNodeRef\n        });\n      }\n    }\n\n    return /*#__PURE__*/React.createElement(DomWrapper, {\n      ref: wrapperNodeRef\n    }, motionChildren);\n  });\n  CSSMotion.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